import FormComponentDelegate from '@/components/hhd/design/FormEngine/FormComponentDelegate.vue';

export default {
  render(context) {
    let templateConfigs = context.templateConfigs || [];
    let res = [];
    templateConfigs.forEach(config => {
      res.push(context.h(FormComponentDelegate, {
        props: {
          config,
          context
        }
      }));
    });
    return this.createFormViewWrapper(context, res);
  },

  createFormViewWrapper(context, list) {
    return context.h('div', {
      class: 'form-engine-view',
      key: `${context.viewId}-${context.actionId}`,
      style: {
        width: `${context.view.pageWidth}px`,
      }
    }, list);
  },
};